package org.csu.wuliu.service;

import org.csu.wuliu.domain.User;
import org.csu.wuliu.persistence.OrderMapper;
import org.csu.wuliu.persistence.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    @Autowired
    private OrderMapper orderMapper;

    public User getUserByusername(String username){
       return userMapper.getUserByUsername(username);
    }

    public User getUserByusernameAndPassword(User user){
        return userMapper.getUserByUsernameAndPassword(user);
    }

    public void  insertUser(User user){
         userMapper.insertUser(user);
    }

    public void deleteUser(User user){
        userMapper.deleteUser(user);
    }

    public void updateUser(User user){
        userMapper.updateUser(user);
    }

    public List<User> getUserList(){
        return userMapper.getUserList();
    }

//    public List<User> searchUser(String keyword){
//        return userMapper.searchUser(keyword);
//    }



}
